use utils::curd::model::*;

/// 获取验证码请求
#[endpoint_derive_for(usage = "query")]
pub struct GetCaptchaReq {}

/// 获取验证码响应
#[endpoint_derive_for(usage = "response")]
pub struct GetCaptchaRes {
    pub uuid: String,
    pub captcha_img: String,
}

/// 账号登录请求
#[endpoint_derive_for(usage = "body")]
pub struct LoginReq {
    pub username: String,
    pub password: String,
    pub captcha: Option<String>,
    pub uuid: Option<String>,
}

/// 登录响应
#[endpoint_derive_for(usage = "response")]
pub struct LoginRes {
    pub access_token: String,
    pub refresh_token: String,
    pub access_expire: String,
    pub user_info: UserInfo,
}

/// 用户信息
#[endpoint_derive_for(usage = "response")]
pub struct UserInfo {
    pub id: String,
    pub username: String,
    pub nickname: String,
    pub avatar: String,
}
